package com.typhoon.spring_shiro.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.typhoon.spring_shiro.dao.PermissionAppDao;
import com.typhoon.spring_shiro.dto.PermissionAppDto;
import com.typhoon.spring_shiro.dto.PermissionDto;
import com.typhoon.spring_shiro.entity.PermissionApp;
import com.typhoon.spring_shiro.service.PermissionAppService;
import com.typhoon.spring_shiro.utils.BeanUtils;
import com.typhoon.spring_shiro.utils.CollectionUtils;

@Service("permissionAppService")
public class PermissionAppServiceImpl implements PermissionAppService {

	private static final Logger LOGGER = LoggerFactory.getLogger(PermissionAppServiceImpl.class);
	
	@Resource
	private PermissionAppDao permissionAppDao;

	@Override
	public int save(PermissionAppDto paramE) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int saveBatch(List<? extends PermissionAppDto> paramList) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int update(PermissionAppDto paramE) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int updateBatch(List<PermissionAppDto> paramList) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int deleteByPK(Long paramK) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int deleteBatchByPK(List<Long> paramList) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int delete(PermissionAppDto paramE) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int deleteBatch(PermissionAppDto paramE) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public PermissionAppDto get(Object paramObject) {
		if(null == paramObject)
			return null;
		PermissionApp app = permissionAppDao.get(paramObject);
		if(null == app)
			return null;
		return BeanUtils.toBean(app, PermissionAppDto.class);
	}

	@Override
	public List<PermissionAppDto> list(Map<String, Object> paramMap) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<PermissionAppDto> list(Object paramObject) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long count(Map<String, Object> paramMap) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public long count(Object paramObject) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public PermissionAppDto queryByPK(Long paramK) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<PermissionAppDto> listAllByPermissions(List<PermissionDto> permissions) {
		if(CollectionUtils.isEmpty(permissions))
			return null;
		List<PermissionApp> apps = this.permissionAppDao.listAllByPermissions(permissions);
		if(CollectionUtils.isEmpty(apps))
			return null;
		return CollectionUtils.transform(apps, PermissionAppDto.class);
	}

}
